﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JeanFish.Blog.Storage
{
    public sealed class Post : PostBase
    {
        public static implicit operator Post(Business.Post post)
        {
            var p = new Post();
            p.Copy(post);
            return p;
        }
        public string ID
        {
            get { return this._id; }
            set { this.SetProperty<string>("ID", value, ref this._id); }
        }
        public string Title
        {
            get { return this._title; }
            set { this.SetProperty<string>("Title", value, ref this._title); }
        }
        public string Text
        {
            get { return this._text; }
            set { this.SetProperty<string>("Text", value, ref this._text); }
        }
        public long CreatedTime
        {
            get { return this._created; }
            set { this.SetProperty<long>("CreateTime", value, ref this._created); }
        }
        public long ModifiedTime
        {
            get { return this._modified; }
            set { this.SetProperty<long>("ModifiedTime", value, ref this._modified); }
        }
        public string Author
        {
            get { return this._author; }
            set { this.SetProperty<string>("Author", value, ref this._author); }
        }
        public string Blog
        {
            get { return this._blog; }
            set { this.SetProperty<string>("Blog", value, ref this._blog); }
        }
        public long Labels
        {
            get { return this._label; }
            set { this.SetProperty<long>("Labels", value, ref this._label); }
        }
        public sealed override  void AcceptChanges()
        {
            base.AcceptChanges();
        }

        protected async override Task<SavedResult> SaveAsync()
        {
            return await Task.FromResult(SavedResult.OK);
        }
    }

}
